<!--#INCLUDE FILE="config.asp"-->
<%
if(Session("AdminAccessLevel") <> 1 and Session("AdminAccessLevel") <> 3) then
	Response.Redirect("admin-login.asp?msg=invalid")
end if

	if (Request("extday") <> "") then

		extday = Request("extday")
		
		set objConnect = server.createObject("ADODB.Connection")       
				objConnect.open conStr
				
				Set oCmd = Server.CreateObject("ADODB.Command")
				  
					oCmd.ActiveConnection = objConnect
					oCmd.CommandText = "sp_extend_days" 
					oCmd.CommandType = 4
					
					Set extDay = oCmd.CreateParameter("@day", 200,1,100, extday)
					oCmd.Parameters.Append extDay
					
					set rss = oCmd.execute
					
			Response.Redirect("admin-codes-manage.asp")
	end if
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- DATE PICKER SCRIPT -->
<link type="text/css" href="../css/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
    $('#list_table tr:nth-child(2n+1)').addClass('alternate');
});
</script>

  

<title>Admin Extender Campaña :: Costa Baja</title>

</head>
<body>
<%
if(request("cId") <> "") then
		codeID = request("cId")
	else 
		codeID = 0
	end if
	
sqlstring = ""
sqlstring = sqlstring & "SELECT *,Products.ProductName, Propertys.PropertyName  FROM Codes "
sqlstring = sqlstring & " Inner join Products on Products.ProductID = Codes.ProductID "
sqlstring = sqlstring & " INNER JOIN Propertys on Propertys.PropertyID = Codes.PropertyID  "
sqlstring = sqlstring & " WHERE CodeID = "&codeID 

set objConnect = server.createObject("ADODB.Connection")   

objConnect.Open conStr

set TblTemp = server.createobject("Adodb.Recordset")
		
		TblTemp.Open Sqlstring, objConnect
		
		If not TblTemp.EOF then
			cId = TblTemp("CodeID")
			code = TblTemp("Code")
			campaign = TblTemp("Campaign")
			expdate = TblTemp("ExpDate")
			originator = TblTemp("Originator")
			product = TblTemp("ProductName")
			properties = TblTemp("PropertyName")
		end if
%>
<div id="main_wrapper">
    	<div class="main_wrapper_margin">
        	
            <div class="admin_top_menu">
            <!--#INCLUDE FILE="admin_menu.asp"--> 
           	</div><!-- END admin_top_menu -->
             
			<h1>Panel de Control</h1>
            <div class="clear"></div>
            
            
            
            <div class="dashboad_wrapper">
       <form action="fei_campaign_extend.asp" method="POST" name="extend" id="extend">
           <fieldset>
           	<legend>Extender Campaña</legend>
            
            <p><strong>Codigo:</strong> <%=code%></p>
			<p><strong>Capaña :</strong> <%=campaign%></p>
            <p><strong>Originador :</strong> <%=originator%></p>
            <p><strong>Producto :</strong> <%=product%></p>
            <p><strong>Agente :</strong> <%=properties%></p>
            <p><strong>Fecha de Expiracion :</strong> <%=expdate%></p>
            <p><strong>Dias por Extender: </strong><input type="text" value="15" size="3" name="extday"/></p>
             <input type="submit"  value="Actualizar"/>
         </fieldset>
       </form>      
 
            </div><!-- .dashboad_wrapper -->
                        
    	</div><!-- END .main_wrapper_margin -->
        
	</div><!-- END #main_wrapper -->

         <!-- FOOTER -->
         
         <!--#INCLUDE file="admin_footer.asp"-->
         
         <!-- END FOOTER -->   

</body>
</html>
